using System;

namespace OhioState.Graphics.Proxy
{
    /// <summary>
    /// Texture1D:  Represents a 1D texture.
    /// </summary>
    [Serializable()]
    public class Texture1D : TextureProxy
    {        
        /// <summary>
        ///  Constructor 
        /// </summary>
        /// <param name="name">name of texture</param>
        /// <param name="width">width</param>
        /// <param name="format">format</param>
        public Texture1D(string name, int width, TexelFormat format)
            : base(name,width,1,1,format)
        {        
        }
        /// <summary>
        ///  Constructor 
        /// </summary>
        /// <param name="name">name of texture</param>
        /// <param name="format">format</param>
        public Texture1D(string name, TexelFormat format)
            : this(name, 256,format)
        {
        }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="width">width</param>
        public Texture1D(int width)
            : this("", width, DefaultTexelFormat)
        {      
        }
        /// <summary>
        /// Output a texture buffer array and the size.
        /// </summary>
        /// <param name="xDim">x dimension</param>
        /// <returns>byte array</returns>
        public virtual byte[] GetTextureByte(out int xDim) { xDim = 1;  return null; }
    }


    /// <summary>
    /// Texture2D:  Represents a 2D texture.
    /// </summary>
    
    [Serializable()]
    public  class Texture2D : TextureProxy
    {
        /// <summary>
        ///  Constructor 
        /// </summary>
        /// <param name="name">name of texture</param>
        /// <param name="width">width</param>
        /// /// <param name="height">height</param>
        /// <param name="format">format</param>
        public Texture2D(string name, int width, int height, TexelFormat format)
            : base(name,width, height,1, format)
        {
        }
        /// <summary>
        ///  Constructor 
        /// </summary>
        /// <param name="name">name of texture</param>
        /// <param name="width">width</param>
        /// <param name="height">height</param>
        public Texture2D(string name,int width, int height)
            : this(name, width, height, DefaultTexelFormat)
        {
        }
        /// <summary>
        /// Output a texture buffer array and the size.
        /// </summary>
        /// <param name="xDim">x dimension</param>
        /// <param name="yDim">y dimension</param>
        /// <returns>byte array</returns>
        //public virtual byte[] GetTextureByte(out int xDim, out int yDim) { xDim = 1; yDim = 1; return null; }
        /// <summary>
        /// Get the texture buffer array as an array of bytes.
        /// </summary>
        /// <param name="texels">A three-dimensional array to be allocated and returned with
        /// the texel data.</param>
        public virtual void GetTexture(out byte[, ,] texels) { texels = null; }
        /// <summary>
        /// Get the texture buffer array as an array of bytes.
        /// </summary>
        /// <param name="texels">A one-dimensional array to be allocated and returned with
        /// the texel data.</param>
        public virtual void GetTexture(out byte[] texels) { texels = null; }
        /// <summary>
        /// Get the texture buffer array as an array of 32-bit unsigned integers.
        /// </summary>
        /// <param name="texels">A three-dimensional array to be allocated and returned with
        /// the texel data.</param>
        public virtual void GetTexture(out uint[,,] texels) { texels = null; }
        /// <summary>
        /// Output a texture buffer array and the size.
        /// </summary>
        /// <param name="xDim">x dimension</param>
        /// <param name="yDim">y dimension</param>
        /// <returns>unsigned int array</returns>
        public virtual uint[] GetTextureInt(out int xDim, out int yDim) { xDim = 1; yDim = 1; return null; }
        /// <summary>
        /// Output a texture buffer array and the size.
        /// </summary>
        /// <param name="xDim">x dimension</param>
        /// <param name="yDim">y dimension</param>
        /// <returns>float array</returns>
        public virtual float[] GetTextureFloat(out int xDim, out int yDim) { xDim = 1; yDim = 1; return null; }
        /// <summary>
        /// Output a texture buffer array and the size.
        /// </summary>
        /// <param name="xDim">x dimension</param>
        /// <param name="yDim">y dimension</param>
        /// <returns>unsigned short array</returns>
        public virtual ushort[] GetTextureShort(out int xDim, out int yDim) { xDim = 1; yDim = 1; return null; }
    }

    /// <summary>
    /// Texture3D:  Represents a 3D texture.
    /// </summary>
    
    [Serializable()]
    public class Texture3D : TextureProxy
    {
        /// <summary>
        ///  Constructor 
        /// </summary>
        /// <param name="name">name of texture</param>
        /// <param name="width">width</param>
        /// <param name="height">height</param>
        /// <param name="depth">depth</param>
        /// <param name="format">format</param>
        public Texture3D(string name, int width, int height, int depth, TexelFormat format)
            : base(name, width, height, depth, format)
        {
        }
        /// <summary>
        ///  Constructor 
        /// </summary>
        /// <param name="width">width</param>
        /// <param name="height">height</param>
        /// <param name="depth">depth</param>
        public Texture3D(int width, int height, int depth)
            : this("", width, height, depth, DefaultTexelFormat)
        {
        }

        /// <summary>
        /// Output a texture buffer array and the size.
        /// </summary>
        /// <param name="xDim">x dimension</param>
        /// <param name="yDim">y dimension</param>
        /// <param name="zDim">z dimension</param>
        /// <returns>byte array</returns>
        public virtual byte[] GetTextureByte(out int xDim, out int yDim, out int zDim) { xDim = 1; yDim = 1; zDim = 1; return null; }
        /// <summary>
        /// Output a texture buffer array and the size.
        /// </summary>
        /// <param name="xDim">x dimension</param>
        /// <param name="yDim">y dimension</param>
        /// <param name="zDim">z dimension</param>
        /// <returns>unsigned int array</returns>
        public virtual uint[] GetTextureInt(out int xDim, out int yDim, out int zDim) { xDim = 1; yDim = 1; zDim = 1; return null; }
        /// <summary>
        /// Output a texture buffer array and the size.
        /// </summary>
        /// <param name="xDim">x dimension</param>
        /// <param name="yDim">y dimension</param>
        /// <param name="zDim">z dimension</param>
        /// <returns>float array</returns>
        public virtual float[] GetTextureFloat(out int xDim, out int yDim, out int zDim) { xDim = 1; yDim = 1; zDim = 1; return null; }
        /// <summary>
        /// Output a texture buffer array and the size.
        /// </summary>
        /// <param name="xDim">x dimension</param>
        /// <param name="yDim">y dimension</param>
        /// <param name="zDim">z dimension</param>
        /// <returns>byte array</returns>
        public virtual byte[] GetTextureShort(out int xDim, out int yDim, out int zDim) { xDim = 1; yDim = 1; zDim = 1; return null; }
    }
}
    